package com.nageoffer.aicloud.controller;

import com.nageoffer.aicloud.common.convention.result.Result;
import com.nageoffer.aicloud.common.convention.result.Results;
import com.nageoffer.aicloud.dto.resp.CaptchaRespDTO;
import com.nageoffer.aicloud.service.CaptchaService;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 图片验证码接口层
 */
@RestController
@RequiredArgsConstructor
public class CaptchaController {
    private final CaptchaService captchaService;

    @PostMapping("/api/ai-cloud/v1/captcha/create")
    public Result<CaptchaRespDTO> createCaptCha(HttpServletRequest request) throws Exception {
        return Results.success(captchaService.createCaptCha(request));
    }
}
